<template>
    <div class="menu">
        <el-menu
                router
                default-active="0"
                class="el-menu-vertical-demo"
                @open="handleOpen"
                @close="handleClose"
                background-color="#7ed1c9"
                text-color="#fff"
                active-text-color="#000">
            <el-submenu index="1">
                <template slot="title">
                    <i class="el-icon-notebook-2"></i>
                    <span>文章管理</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="/admin/published"><i class="el-icon-finished"></i>已发表</el-menu-item>
                    <el-menu-item index="/admin/unpublished"><i class="el-icon-turn-off"></i>草稿箱</el-menu-item>
                    <el-menu-item index="/admin/dustbin"><i class="el-icon-delete"></i>垃圾箱</el-menu-item>
                    <el-menu-item index="/admin/editArticle"><i class="el-icon-edit-outline"></i>写文章</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
                <template slot="title">
                    <i class="el-icon-wallet"></i>
                    <span>其他管理</span>
                </template>
                <el-menu-item-group>
                    <el-menu-item index="/admin/category"><i class="el-icon-folder"></i>分类管理</el-menu-item>
                    <el-menu-item index="/admin/tags"><i class="el-icon-attract"></i>标签管理</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-menu-item index="/admin/blogInfo">
                <template slot="title">
                    <i class="el-icon-cpu" style="color: #ffffff"></i>
                    <span slot="title">博客信息</span>
                </template>
            </el-menu-item>
        </el-menu>
    </div>
</template>

<script>
    export default {
        name: "menu",
        data() {
            return {
            };
        },
        methods: {
            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }
</script>

<style>
    .menu{
        overflow: hidden;
    }
    .menu .el-submenu{
        margin-left: 0px;
    }
    .menu .el-menu-item-group__title{
        padding: 2px;
    }
    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 200px;
        min-height: 400px;
    }
    .el-icon-arrow-down:before{
        color: #ffffff;
    }

</style>